//
//  UIButton-Extension.swift
//  WSWB
//
//  Created by 刘 伟生 on 16/1/7.
//  Copyright © 2016年 seasa. All rights reserved.
//

import UIKit

//给UIButton扩展一个分类
extension UIButton {
    
    //创建一个扩展方法
   class func createComposeBtn(imageName : String, bgImageName : String) -> UIButton  {
        
        let btn = UIButton()
        btn.setImage(UIImage(named: imageName), forState: .Normal)
        btn.setImage(UIImage(named: imageName + "_highlighted"), forState: .Highlighted)
        btn.setBackgroundImage(UIImage(named: bgImageName), forState: .Normal)
        btn.setBackgroundImage(UIImage(named: bgImageName + "_highlighted"), forState: .Highlighted)
        
        btn.sizeToFit()
    
        
        return btn
    
    }
    
    
}